package com.ynt.pay.common.exception;

import com.ynt.pay.common.enums.ExceptionCodes;
import lombok.Data;

/**
 * 公共异常
 *
 * @Author: ganbo
 * @Date: 2019/9/27 18:16
 */

@Data
public class PayException extends RuntimeException {

    private String code;

    public PayException(String coce, String message) {
        super(message);
        this.code = coce;
    }


    public static PayException build(ExceptionCodes exceptionCode) {
        return new PayException(exceptionCode.getCode(), exceptionCode.getDesc());
    }

}
